﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace JasRibbonApplicatie.Converters
{
    class TypeToStyleConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {

            Style style = new Style(typeof(TextBlock));

            if (value is Type && (Type)value  == typeof(Materiaaltype))
            {
                style.Setters.Add(new Setter(TextBlock.FontWeightProperty, FontWeights.Bold));
                style.Setters.Add(new Setter(TextBlock.PaddingProperty, new Thickness(0)));
            }
            else
            {
                style.Setters.Add(new Setter(TextBlock.FontWeightProperty, FontWeights.Bold));
                style.Setters.Add(new Setter(TextBlock.PaddingProperty, new Thickness(10,0,0,0)));
            }
            return style;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
